const KEY = 'TOKEN_KEY'
const store = sessionStorage // localStorage cookie

/**
 * 保存token
 * @param {*} user
 */
export const saveToken = token => {
	store.setItem(KEY, token)
}

/**
 * 获取token
 */
export const getToken = () => {
	let token = store.getItem(KEY)
	if (!token) {
		return null
	}
	return token
}

/**
 * 删除token
 */
export const removeToken= ()=>{
    store.removeItem(KEY)
}

